package com.icloud.system.boot.controller.internal;

import com.icloud.common.web.domain.UserDto;
import com.icloud.system.boot.service.AdminUserAuthService;
import com.icloud.system.boot.service.AppCustomerAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "内部-前台客户权限接口")
@RequestMapping("/app")
@RequiredArgsConstructor
public class InternalAppCustomerAuthController {

    private final AppCustomerAuthService appCustomerAuthService;

    @ApiOperation("根据用户名获取前台客户通用信息")
    @RequestMapping(value = "/loadByUsername", method = RequestMethod.GET)
    @ResponseBody
    public UserDto loadCustomerByUsername(@ApiParam("账户名")@RequestParam String username) {
        return appCustomerAuthService.loadCustomerByUsername(username);
    }
}
